//
//  StarView.h
//  intelligent
//
//  Created by Ace Portgas on 2024/3/3.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@class StarView;
@protocol StarViewDelegate <NSObject>

-(void)starView:(StarView *)view score:(float)score;

@end
@interface StarView : UIView
@property (nonatomic,readonly)NSInteger starNumber;
@property (nonatomic,weak) id <StarViewDelegate> delegate;
/**
 *  Init TQStarRatingView
 *
 *  @param frame  Rectangles
 *  @param number 星星个数
 *
 *  @return TQStarRatingViewObject
 */
- (id)initWithFrame:(CGRect)frame numberOfStar:(int)number;

/**
 *  设置控件分数
 *
 *  @param score     分数，必须在 0 － 1 之间
 *  @param isAnimate 是否启用动画
 */
- (void)setScore:(float)score withAnimation:(bool)isAnimate;

/**
 *  设置控件分数
 *
 *  @param score      分数，必须在 0 － 1 之间
 *  @param isAnimate  是否启用动画
 *  @param completion 动画完成block
 */
- (void)setScore:(float)score withAnimation:(bool)isAnimate completion:(void (^)(BOOL finished))completion;

@end

NS_ASSUME_NONNULL_END
